function Dsy()
{
	this.Items = {};
}
Dsy.prototype.add = function(id,iArray)
{
	this.Items[id] = iArray;
}
Dsy.prototype.Exists = function(id)
{
	if(typeof(this.Items[id]) == "undefined") return false;
	return true;
}

function change(v){
	var str="0";
	for(i=0;i<v;i++){ str+=("_"+(document.getElementById(s[i]).selectedIndex-1));};
	var ss=document.getElementById(s[v]);
	with(ss){
		length = 0;
		options[0]=new Option(opt0[v],"");
		
		if(v && document.getElementById(s[v-1]).selectedIndex>0 || !v)
		{
			if(dsy.Exists(str)){
				ar = dsy.Items[str];
				for(i=0;i<ar.length;i++){
					options[length]=new Option(ar[i],ar[i]);
				}
				if(v){
					options[1].selected = true;
				}
			}
			
		}
		if(++v<s.length){change(v);}
	}
}
function change2(v){
	var str="0";
	for(i=0;i<v;i++){ str+=("_"+(document.getElementById(r[i]).selectedIndex-1));};
	var ss=document.getElementById(r[v]);
	with(ss){
		length = 0;
		options[0]=new Option(opt0[v],"");
		
		if(v && document.getElementById(r[v-1]).selectedIndex>0 || !v)
		{
			if(dsy.Exists(str)){
				ar = dsy.Items[str];
				for(i=0;i<ar.length;i++){
					options[length]=new Option(ar[i],ar[i]);
				}
				if(v){
					options[1].selected = true;
				}
			}
			
		}
		if(++v<r.length){change2(v);}
	}
}

function change3(v){
	var str="0";
	for(i=0;i<v;i++){ str+=("_"+(document.getElementById(a[i]).selectedIndex-1));};
	var ss=document.getElementById(a[v]);
	with(ss){
		length = 0;
		options[0]=new Option(opt0[v],"");
		
		if(v && document.getElementById(a[v-1]).selectedIndex>0 || !v)
		{
			if(dsy1.Exists(str)){
				ar = dsy1.Items[str];
				for(i=0;i<ar.length;i++){
					options[length]=new Option(ar[i],ar[i]);
				}
				if(v){
					options[0].selected = true;
				}
			}
			
		}
		if(++v<r.length){change3(v);}
	}
}
function change4(v){
	var str="0";
	for(i=0;i<v;i++){ str+=("_"+(document.getElementById(b[i]).selectedIndex-1));};
	var ss=document.getElementById(b[v]);
	with(ss){
		length = 0;
		options[0]=new Option(opt0[v],"");
		
		if(v && document.getElementById(b[v-1]).selectedIndex>0 || !v)
		{
			if(dsy1.Exists(str)){
				ar = dsy1.Items[str];
				for(i=0;i<ar.length;i++){
					options[length]=new Option(ar[i],ar[i]);
				}
				if(v){
					options[0].selected = true;
				}
			}
			
		}
		if(++v<r.length){change3(v);}
	}
}

var dsy = new Dsy();
var dsy1 = new Dsy();

dsy1.add("0",["意大利","西班牙","德国","法国","荷兰","英国","其他"]);

//dsy.add("0_0",["威尼斯","罗马","米兰","都灵","佛罗伦萨","那不勒斯","热那亚","亚历山德里亚","波伦里亚","布里西亚","莱切","帕多瓦","帕尔马","佩鲁贾","比萨"]);

dsy1.add("0_0",['罗马','都灵','米兰','普拉拖','科莫','卢卡','马萨','比萨','福贾','莱切','杰拉','巴里','丰迪','保拉','瓦雷泽','比耶拉','诺瓦拉','阿斯蒂','库内奥','萨沃纳','热那亚','帕维亚','贝加莫','维罗纳','特伦托','维琴察','乌迪内','帕多瓦','曼托瓦','罗维戈','帕尔马','费拉拉','摩德纳','卡拉拉','拉韦纳','切塞纳','里米尼','里窝那','锡耶纳','佩萨罗','安科纳','佩鲁贾','特尔尼','拉奎拉','基耶蒂','巴列塔','塔兰托','卡塞塔','那波利','萨莱塔','科森扎','墨西拿','巴勒莫','拉古萨','威尼斯','波坦察'
 ,'韦尔切利','皮亚琴察','布雷西亚','博尔扎诺','特雷维索','博洛尼亚','佛罗伦萨','佩斯卡拉','圣塞韦罗','贝内文托','安德里亚','克罗托内','卡坦扎罗','特拉帕尼','卡塔尼亚','锡拉库萨','莫尔费塔','布林迪西','格罗塞托','卡利亚里'
 ,'的里雅斯特','拉斯佩齐亚','布雷萨诺内','阿尔塔穆拉'
        ,'阿格里真托','其他']);
dsy1.add("0_1",['马德里','阿尔赫西拉斯','阿拉贡','阿利坎特','阿斯图里亚斯','埃布罗河','埃斯科利亚尔','埃斯特雷马杜拉','安达卢西亚','巴利亚多利德','巴利阿里群岛','巴伦西亚','巴塞罗那','巴斯克地区','毕尔巴鄂','布尔戈斯','菲尼斯特雷角','格拉纳达','瓜达尔基维尔河','加那利群岛','加泰罗尼亚','卡斯蒂利亚','加利西亚','科尔多瓦','科斯塔贝尔德','科斯塔布拉瓦','科斯塔布兰卡','科斯塔德尔索尔','科斯塔多拉达','拉科鲁尼亚','拉斯帕耳马斯','莱昂','雷阿尔城','加的斯','里奥廷托','马拉加','马略卡','米诺卡','穆尔西亚','纳瓦拉','帕尔马','潘普洛纳','萨拉戈萨','塞维利亚','塔古斯河','特拉法尔加角','特纳里夫','托莱多']);
dsy1.add("0_2",['柏林','凯泽斯劳腾','莱比锡','慕尼黑','斯图加特','法兰克福','科隆','多特蒙德','汉诺威','汉堡','杜塞尔多夫','克林斯顿','弗赖堡','盖尔森基兴','纽伦堡','埃尔富特','马格德堡','不来梅','什未林','德累斯顿','勃兰登堡','其他']);
dsy1.add("0_3",['巴黎','马赛','里昂','图卢兹','尼斯','南特','斯特拉斯堡','蒙彼利埃','波尔多','里尔','雷恩','勒阿弗尔','兰斯','圣艾蒂安','土伦','格勒诺布尔','昂热','第戎','布雷斯特','勒芒','克莱蒙费朗','亚眠','普罗旺斯地区艾克斯','利摩日','尼姆','图尔','圣但尼','维勒班','梅斯','贝桑松','卡昂','奥尔良','米卢斯','鲁昂','布洛涅-比扬古','佩皮尼昂','南锡','其他']);
dsy1.add("0_4",['阿姆斯特丹','鹿特丹','海牙','乌得勒支','埃因霍温','阿尔梅勒','蒂尔堡','格罗宁根','奈梅亨','哈勒姆','阿纳姆','布雷达','阿珀尔多伦','恩斯赫德','阿默斯福特','多德雷赫特','祖特尔梅尔','莱顿','马斯特里赫特','兹沃勒','斯海尔托亨博斯','其他']);
dsy1.add("0_5",['伦敦','伯明翰','布里斯托','利兹','利物浦','曼彻斯特','纽卡斯尔','诺丁汉','谢菲尔德','爱丁堡','格拉斯哥','卡迪夫','贝尔法斯特','剑桥','牛津','朴茨茅斯','布莱顿','巴斯','埃克塞特','南安普敦','其他']);
//分割*************************
dsy.add("0",["安徽","北京","福建","甘肃","广东","广西","贵州","海南","河北","河南","黑龙江","湖北","湖南","吉林","江苏","江西","辽宁","内蒙古","宁夏","青海","山东","山西","陕西","上海","四川","天津","西藏","新疆","云南","浙江","重庆","台湾","香港","澳门","海外"]);

dsy.add("0_0",["合肥","安庆","蚌埠","亳州","巢湖","滁州","阜阳","贵池","淮北","淮化","淮南","黄山","九华山","六安","马鞍山","宿州","铜陵","屯溪","芜湖","宣城"]);
dsy.add("0_1",["中南海","东城","西城","崇文","宣武","朝阳","丰台","石景山","海淀","门头沟","房山","通州","顺义","昌平","大兴","平谷","怀柔","密云","延庆"]);
dsy.add("0_2",["福州","福安","龙岩","南平","宁德","莆田","泉州","三明","邵武","石狮","晋江","永安","武夷山","厦门","漳州"]);
dsy.add("0_3",["兰州","白银","定西","敦煌","甘南","金昌","酒泉","临夏","平凉","天水","武都","武威","西峰","嘉峪关","张掖"]);
dsy.add("0_4",["广州","潮阳","潮州","澄海","东莞","佛山","河源","惠州","江门","揭阳","开平","茂名","梅州","清远","汕头","汕尾","韶关","深圳","顺德","阳江","英德","云浮","增城","湛江","肇庆","中山","珠海"]);
dsy.add("0_5",["百色","北海","崇左","防城港","桂林","贵港","河池","贺州","来宾","柳州","南宁","钦州","梧州","玉林"]);
dsy.add("0_6",["贵阳","安顺","毕节","都匀","凯里","六盘水","铜仁","兴义","玉屏","遵义"]);
dsy.add("0_7",["海口","三亚","五指山","琼海","儋州","文昌","万宁","东方","定安","屯昌","澄迈","临高","万宁","白沙黎族自治县","保亭黎族苗族自治县","昌江黎族自治县","乐东黎族自治县","陵水黎族自治县","琼中黎族苗族自治县","西沙群岛","南沙群岛","中沙群岛"]);
dsy.add("0_8",["石家庄","保定","北戴河","沧州","承德","丰润","邯郸","衡水","廊坊","南戴河","秦皇岛","唐山","新城","邢台","张家口"]);
dsy.add("0_9",["郑州","安阳","鹤壁","潢川","焦作","济源","开封","漯河","洛阳","南阳","平顶山","濮阳","三门峡","商丘","新乡","信阳","许昌","周口","驻马店"]);
dsy.add("0_10",["哈尔滨","北安","大庆","大兴安岭","鹤岗","黑河","佳木斯","鸡西","牡丹江","齐齐哈尔","七台河","双鸭山","绥化","伊春"]);
dsy.add("0_11",["武汉","恩施","鄂州","黄冈","黄石","荆门","荆州","潜江","十堰","随州","武穴","仙桃","咸宁","襄阳","襄樊","孝感","宜昌"]);
dsy.add("0_12",["长沙","常德","郴州","衡阳","怀化","吉首","娄底","邵阳","湘潭","益阳","岳阳","永州","张家界","株洲"]);
dsy.add("0_13",["长春","白城","白山","珲春","辽源","梅河","吉林", "四平","松原","通化","延边"]);
dsy.add("0_14",["南京","常熟","常州","海门","淮安","江都","江阴","昆山","连云港","南通","启东","沭阳","宿迁","苏州","太仓","泰州","同里","无锡","徐州","盐城","扬州","宜兴","仪征","张家港","镇江","周庄"]);
dsy.add("0_15",["南昌","抚州","赣州","吉安","景德镇","井冈山","九江","庐山","萍乡","上饶","新余","宜春","鹰潭"]);
dsy.add("0_16",["沈阳","鞍山","本溪","朝阳","大连","丹东","抚顺","阜新","葫芦岛","锦州","辽阳","盘锦","铁岭","营口"]);
dsy.add("0_17",["呼和浩特","阿拉善盟","包头","赤峰","东胜","海拉尔","集宁","临河","通辽","乌海","乌兰浩特","锡林浩特"]);
dsy.add("0_18",["银川","固原","中卫","石嘴山","吴忠"]);
dsy.add("0_19",["西宁","德令哈","格尔木","共和","海东","海晏","玛沁","同仁","玉树"]);
dsy.add("0_20",["济南","滨州","兖州","德州","东营","菏泽","济宁","莱芜","聊城","临沂","蓬莱","青岛","曲阜","日照","泰安","潍坊","威海","烟台","枣庄","淄博"]);
dsy.add("0_21",["太原","长治","大同","候马","晋城","离石","临汾","宁武","朔州","忻州","阳泉","榆次","运城"]);
dsy.add("0_22",["西安","安康","宝鸡","汉中","渭南","商州","绥德","铜川","咸阳","延安","榆林"]);
dsy.add("0_23",["上海","崇明","黄浦","卢湾","徐汇","长宁","静安","普陀","闸北","虹口","杨浦","闵行","宝山","嘉定","浦东","金山","松江","青浦","南汇","奉贤","朱家角"]);
dsy.add("0_24",["成都","巴中","达州","德阳","都江堰","峨眉山","涪陵","广安","广元","九寨沟","康定","乐山","泸州","马尔康","绵阳","眉山","南充","内江","攀枝花","遂宁","汶川","西昌","雅安", "雅安","宜宾","自贡","资阳"]);
dsy.add("0_25",["天津","和平","东丽","河东","西青","河西","津南","南开","北辰","河北","武清","红挢","塘沽","汉沽","大港","宁河","静海","宝坻","蓟县"]);
dsy.add("0_26",["拉萨","阿里","昌都","林芝","那曲","日喀则","山南"]);
dsy.add("0_27",["乌鲁木齐","阿克苏","阿勒泰","阿图什","博乐","昌吉","东山","哈密","和田","喀什","克拉玛依","库车","库尔勒","奎屯","石河子","塔城","吐鲁番","伊宁"]);
dsy.add("0_28",["昆明","大理","保山","楚雄","大理","东川","个旧","景洪","开远","临沧","丽江","六库","潞西","曲靖","思茅","文山","西双版纳","玉溪","中甸","昭通"]);
dsy.add("0_29",["杭州","安吉","慈溪","定海","奉化","海盐","黄岩","湖州","嘉兴","金华","临安","临海","丽水","宁波","瓯海","平湖","千岛湖","衢州","江山","瑞安","绍兴","嵊州","台州","温岭", "温岭","温州","余姚","舟山"]);
dsy.add("0_30",["重庆","万州","涪陵","渝中","大渡口","江北","沙坪坝","九龙坡","南岸","北碚","万盛","双挢","渝北","巴南","黔江","长寿","綦江","潼南","铜梁","大足","荣昌","壁山","梁平","城口","丰都","垫江","武隆","忠县","开县","云阳","奉节","巫山","巫溪","石柱","秀山","酉阳","彭水","江津","合川","永川","南川"]);
dsy.add("0_31",["台北","基隆","台南","台中","高雄","屏东","南投","云林","新竹","彰化","苗栗","嘉义","花莲","桃园","宜兰","台东","金门","马祖","澎湖","其它"]);
dsy.add("0_32",["香港","九龙","新界"]);
dsy.add("0_33",["澳门"]);
dsy.add("0_34",["美国","英国","法国","瑞士","澳洲","新西兰","加拿大","奥地利","韩国","日本","德国","意大利","西班牙","俄罗斯","泰国","印度","荷兰","新加坡","欧洲","北美","南美","亚洲","非洲","大洋洲"]);

var s=["s1","s2"];
var r=["r1","r2"];
var a=["a1","a2"];
var b=["b1","b2"];
var opt0 = ["请选择","请选择"];
function setup()
{
	for(i=0;i<s.length-1;i++)
		document.getElementById(s[i]).onchange=new Function("change("+(i+1)+")");
	change(0);
}
function setup2()
{
	for(i=0;i<r.length-1;i++)
		document.getElementById(r[i]).onchange=new Function("change2("+(i+1)+")");
	change2(0);
}
function setup3()
{
	for(i=0;i<a.length-1;i++){
		document.getElementById(a[i]).onchange=new Function("change3("+(i+1)+")");
    }
	change3(0);
}
function setup4()
{
	for(i=0;i<b.length-1;i++){
		document.getElementById(b[i]).onchange=new Function("change4("+(i+1)+")");
    }
	change4(0);
}
